package com.my.chapter15;

public class practice3 {
    static
    SixTuple<Cat,Dog,String,Float,Double,Byte> a() {
        return new
                SixTuple<Cat,Dog,String,Float,Double,Byte>(
                new Cat(), new Dog(), "hi", (float)4.7,
                1.1, (byte)1);
    }

    public static void main(String[] args) {
        System.out.println(a());
    }
}

class TwoTuple<A,B>{
    public final A first;
    public final B second;
    public TwoTuple(A a,B b){
        first = a;
        second = b;
    }

    @Override
    public String toString() {
        return "{ " + first +
                ", " + second +
                '}';
    }
}

class ThreeTuple<A,B,C> extends TwoTuple<A,B>{
    public final C third;
    public ThreeTuple(A a,B b,C c){
        super(a,b);
        third = c;
    }

    @Override
    public String toString() {
        return "{ " + first +
                ", " + second +
                ", " + third +
                '}';
    }
}

class FourTuple<A,B,C,D> extends ThreeTuple<A,B,C>{
    public final D fourth;
    public FourTuple(A a,B b,C c,D d){
        super(a,b,c);
        fourth = d;
    }

    @Override
    public String toString() {
        return "{ " + first +
                ", " + second +
                ", " + third +
                ", " + fourth +
                '}';
    }
}

class FiveTuple<A,B,C,D,E> extends FourTuple<A,B,C,D>{
    public final E fifth;
    public FiveTuple(A a,B b,C c,D d,E e){
        super(a,b,c,d);
        fifth = e;
    }

    @Override
    public String toString() {
        return "{" + first +
                ", " + second +
                ", " + third +
                ", " + fourth +
                ", " + fifth +
                '}';
    }
}

class SixTuple<A,B,C,D,E,F> extends FiveTuple<A,B,C,D,E>{
    public final F sixth;
    public SixTuple(A a,B b,C c,D d,E e,F f){
        super(a,b,c,d,e);
        sixth = f;
    }

    @Override
    public String toString() {
        return "{" + first +
                ", " + second +
                ", " + third +
                ", " + fourth +
                ", " + fifth +
                ", " + sixth +
                '}';
    }
}

